/*
 * Copyright (c) 2011 Jean-Marc Perronne
 * Ensisa, 12 rue des Freres Lumieres, F-68093 Mulhouse cedex
 * All rights reserved.
 *
 * The copyright of this software is owned by Werner Randelshofer. 
 * You may not use, copy or modify this software, except in  
 * accordance with the license agreement you entered into with  
 * Jean-Marc Perronne. For details see accompanying license terms. 
 */

package fr.uha.ensisa.jmp.drone.app;

public class DroneConstants
{
	//network
	public static final String WIFI_ARDRONE_IP = "192.168.1.1";
	public static final String NETWORK_INTERFACE = "en1"; //wifi nerwork interface
	
	public static final int UDP_AT_BUFFER_SIZE = 2048;
	public static final int UDP_NAV_BUFFER_SIZE = 2048;
	public static final int UDP_VIDEO_BUFFER_SIZE = 64000;
	public static final int TCP_CONFIG_BUFFER_SIZE = 4096;

	public static final int UDP_TIMEOUT = 1000;

	public static final int AT_COMMAND_PORT = 5556;
	public static final int VIDEO_PORT = 5555;
	public static final int NAVDATA_PORT = 5554;
	public static final int CONTROL_PORT = 5559;
	
	public final static byte WAKEUP_BYTES[] = {0x01, 0x00, 0x00, 0x00};

	
	//Navadata
	
	public static final int NAVDATA_HEADER = 0x55667788;

	public static final int NAVDATA_DEMO_TAG = 0;
	public static final int NAVDATA_TIME_TAG = 1;
	public static final int NAVDATA_RAW_MEASURES_TAG = 2;
	public static final int NAVDATA_PHYS_MEASURES_TAG = 3;
	public static final int NAVDATA_GYROS_OFFSETS_TAG = 4;
	public static final int NAVDATA_EULER_ANGLES_TAG = 5;
	public static final int NAVDATA_REFERENCES_TAG = 6;
	public static final int NAVDATA_TRIMS_TAG = 7;
	public static final int NAVDATA_RC_REFERENCES_TAG = 8;
	public static final int NAVDATA_PWM_TAG = 9;
	public static final int NAVDATA_ALTITUDE_TAG = 10;
	public static final int NAVDATA_VISION_RAW_TAG = 11;
	public static final int NAVDATA_VISION_OF_TAG = 12;
	public static final int NAVDATA_VISION_TAG = 13;
	public static final int NAVDATA_VISION_PERF_TAG = 14;
	public static final int NAVDATA_TRACKERS_SEND_TAG = 15;
	public static final int NAVDATA_VISION_DETECT_TAG = 16;
	public static final int NAVDATA_WATCHDOG_TAG = 17;
	public static final int NAVDATA_ADC_DATA_FRAME_TAG = 18;
	public static final int NAVDATA_VIDEO_STREAM_TAG=19;
	
	public static final int NAVDATA_CKS_TAG = 0xFFFF;
	
	//boot
	public static final int MAX_BOOT_RETRY = 20;
	
	//at commands
	public static final int AT_REFRESH_MS = 30;
	public static final int AT_ALTITUDE = 2000;
	
	//recorders
	public static final String RECORDS_DIR = System.getProperty("user.dir")+"/records";

	public static final String NAVDATA_RECORDS_DIR = RECORDS_DIR+"/navdata";
	public static final String NAVDATA_DEMO_RECORDS_DIR = NAVDATA_RECORDS_DIR+"/demo/";

	public static final String NAVDATA_DEMO_EXT = "txt";
	public static final char NAVDATA_DEMO_SEPARATOR = ' ';
	
	public static final String PICTURE_WRITER_FORMAT = "png";

	public static final String VIDEO_RECORDS_DIR = RECORDS_DIR+"/videos/";
	public static final String PICTURES_RECORDS_DIR = RECORDS_DIR+"/pictures/";
	public static final String CONFIGS_RECORDS_DIR = RECORDS_DIR+"/configs/";
	
	public static final String CONFIGS_EXT =  "txt";
	public static final String DEFAULT_CONFIGS_FILE_NAME = "drone_configs";

	//consumers keys
	public static final String NAVDATA_DEMO_RECORDER_KEY = "navadata_demo_recorder";
	public static final String PICTURE_RECORDER_KEY = "picture_recorder";
	public static final String VIDEO_RECORDER_KEY = "video_recorder";
	public static final String DRONE_CONFIG_RECORDER_KEY = "drone_config_recorder";
	public static final String COCKPIT_KEY = "cockpit";
	
	//Video data
	public final static int VIDEO_FRAMERATE = 15;
}
